Feature: The user can navigate in the XML document with the cursor

  Background: I have an XML file opened and the edit XML displayed
    Given a file named "example.xml" with:
    """
    <?xml version="3.1" encoding="ascii-128"?>
    <egy key1="value1" key2="value2" key3="value3">
      <ketto/>
      ittt is egy
      <harom key4="value4" key5="value5">
        hello
        <negy>
          naezmi
          <!--dsaji0w-->
        </negy>
      </harom>
      <!--eqwuo21i-->
    </egy>
    """
    When I launch XML Editor interactively
    And I type "1"
    And I type "example.xml"
    And I type "2"

  @forward
  Scenario: When I move the cursor forward
    When I type "5"
    Then the cursor should be `~~> <ketto/>`

  @forward
  Scenario: When I move the cursor forward 2 times
    When I type "5,5" in succession
    Then the cursor should be `~~> ittt is egy`

  @forward
  Scenario: When I move the cursor forward 3 times
    When I type "5,5,5" in succession
    Then the cursor should be `~~> <harom key4="value4" key5="value5">`

  @forward
  Scenario: When I move the cursor forward 4 times
    When I type "5,5,5,5" in succession
    Then the cursor should be `~~> hello`

  @forward
  Scenario: When I move the cursor forward 5 times
    When I type "5,5,5,5,5" in succession
    Then the cursor should be `~~> <negy>`

  @forward
  Scenario: When I move the cursor forward 6 times
    When I type "5,5,5,5,5,5" in succession
    Then the cursor should be `~~> naezmi`

  @forward
  Scenario: When I move the cursor forward 7 times
    When I type "5,5,5,5,5,5,5" in succession
    Then the cursor should be `~~> <!--dsaji0w-->`

  @forward
  Scenario: When I move the cursor forward 8 times
    When I type "5,5,5,5,5,5,5,5" in succession
    Then the cursor should be `~~> <!--eqwuo21i-->`

  @forward
  Scenario: When I move the cursor forward 9 times
    When I type "5,5,5,5,5,5,5,5,5" in succession
    Then the cursor should be `~~> <egy key1="value1" key2="value2" key3="value3">`

  @backward
  Scenario: When I move the cursor backward
    When I type "5,5,5,5,5,5,5,5" in succession
    When I type "4" in succession
    Then the cursor should be `~~> <!--dsaji0w-->`

  @backward
  Scenario: When I move the cursor backward 2 times
    When I type "5,5,5,5,5,5,5,5" in succession
    When I type "4,4" in succession
    Then the cursor should be `~~> naezmi`

  @backward
  Scenario: When I move the cursor backward 3 times
    When I type "5,5,5,5,5,5,5,5" in succession
    When I type "4,4,4" in succession
    Then the cursor should be `~~> <negy>`

  @backward
  Scenario: When I move the cursor backward 4 times
    When I type "5,5,5,5,5,5,5,5" in succession
    When I type "4,4,4,4" in succession
    Then the cursor should be `~~> hello`

  @backward
  Scenario: When I move the cursor backward 5 times
    When I type "5,5,5,5,5,5,5,5" in succession
    When I type "4,4,4,4,4" in succession
    Then the cursor should be `~~> <harom key4="value4" key5="value5">`

  @backward
  Scenario: When I move the cursor backward 6 times
    When I type "5,5,5,5,5,5,5,5" in succession
    When I type "4,4,4,4,4,4" in succession
    Then the cursor should be `~~> ittt is egy`

  @backward
  Scenario: When I move the cursor backward 7 times
    When I type "5,5,5,5,5,5,5,5" in succession
    When I type "4,4,4,4,4,4,4" in succession
    Then the cursor should be `~~> <ketto/>`

  @backward
  Scenario: When I move the cursor backward 8 times
    When I type "5,5,5,5,5,5,5,5" in succession
    When I type "4,4,4,4,4,4,4,4" in succession
    Then the cursor should be `~~> <egy key1="value1" key2="value2" key3="value3">`

  @vertical
  Scenario: When I move the cursor to the last child
    When I type "7" in succession
    Then the cursor should be `~~> <!--eqwuo21i-->`

  @vertical
  Scenario: When I move the cursor to the parent from a child
    When I type "5,5,6" in succession
    Then the cursor should be `~~> <egy key1="value1" key2="value2" key3="value3">`